package com.gxw.rxjavatest.model;

import com.gxw.rxjavatest.data.ApiService;
import com.gxw.rxjavatest.model.bean.ImageResponse;
import com.gxw.rxjavatest.model.bean.UpLogin;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.adapter.guava.GuavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by GXW on 2016/4/12 0012.
 * email:603004002@qq.com
 */
public class ImageModel {

    public Call<ImageResponse> upImage(UpLogin upLogin, String imgStr) {
        Retrofit retrofit_s = new Retrofit.Builder()
                .baseUrl("http://117.79.231.125:17080")
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(GuavaCallAdapterFactory.create())
                .build();

        ApiService apiService = retrofit_s.create(ApiService.class);
        Call<ImageResponse> info2 = apiService.upImage(upLogin.getLoginID(), upLogin.getPassword(), upLogin.getDeviceType(), imgStr);
        return info2;

    }

}
